package com.isoftstone.framework.druid;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Description:
 * @Author: guoX
 * @Date: 2020/6/22
 */
@Component
@Slf4j
public class InitDataSource {


    public void init(){
        //DataSourceUtil.initDataSource();	//初始化master

//        DruidDataSource druidDataSource = new DruidDataSource();
//        druidDataSource.setUsername(CIBBANKuserName);
//        druidDataSource.setPassword(CIBBANKpassWord);
//        druidDataSource.setDriverClassName(CIBBANKdriverClassName);
//        druidDataSource.setUrl(CIBBANKurl);
//        //添加数据源到map
//        DataSourceUtil.addDataSource("CIBBANK", druidDataSource);


//        DruidDataSource acctdruidDataSource = new DruidDataSource();
//        acctdruidDataSource.setUsername(ACCOUNTuserName);
//        acctdruidDataSource.setPassword(ACCOUNTpassWord);
//        acctdruidDataSource.setDriverClassName(ACCOUNTdriverClassName);
//        acctdruidDataSource.setUrl(ACCOUNTurl);
//        //添加数据源到map
//        DataSourceUtil.addDataSource("ACCOUNT", acctdruidDataSource);
        log.info("***********************数据源加载中完毕***********************");

        //刷新
       // DataSourceUtil.flushDataSource();

       // ICodeTableService cacheManager = SpringContext.getBean(ICodeTableService.class);

        log.info("***********************刷新数据源***********************");
    }
}
